/*
 * $Id: object-furniture.h 315 2010-03-25 23:57:03Z cmtonkinson@gmail.com $
 *
 * This file is part of the Symphony project <http://code.google.com/p/symphonymud/>
 * Copyright 2005-2010 Chris Tonkinson <cmtonkinson@gmail.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef H_SYMPHONY_OBJECT_FURNITURE
#define H_SYMPHONY_OBJECT_FURNITURE

#include "mysql.h"

class Creature;

class ObjFurniture {
  public:
    // constructors...
    ObjFurniture( void );
    ObjFurniture( const ObjFurniture& ref );
    ObjFurniture( ROW row );
    ~ObjFurniture( void );

    // constants...
    enum Position { Position_Undefined = 0, Position_LayOn, Position_SitAt, Position_SitOn, Position_StandOn };

    // public accessors
    void      capacity( const unsigned& capacity )      { _capacity = capacity; }
    unsigned  capacity( void ) const                    { return _capacity; }
    void      layOn( const unsigned& layOn )            { _layOn = layOn; }
    unsigned  layOn( void ) const                       { return _layOn; }
    void      sitAt( const unsigned& sitAt )            { _sitAt = sitAt; }
    unsigned  sitAt( void ) const                       { return _sitAt; }
    void      sitOn( const unsigned& sitOn )            { _sitOn = sitOn; }
    unsigned  sitOn( void ) const                       { return _sitOn; }
    void      standOn( const unsigned& standOn )        { _standOn = standOn; }
    unsigned  standOn( void ) const                     { return _standOn; }
    void      current( const unsigned& current )        { _current = current; }
    unsigned  current( void ) const                     { return _current; }
    std::map<Position,std::list<Creature*> >&           creatures( void )       { return _creatures; }
    const std::map<Position,std::list<Creature*> >&     creatures( void ) const { return _creatures; }

    // general methods
    bool  add( Creature* creature, const Position& position );
    bool  remove( Creature* creature );

  private:
    unsigned _capacity; // how many, in total, can be using this at once?
    unsigned _layOn;    // how many can lay on this?
    unsigned _sitAt;    // how many can sit at this?
    unsigned _sitOn;    // how many can sit on this?
    unsigned _standOn;  // how many can stand on this?
    unsigned _current;  // how many, in total, are currently here?
    std::map<Position,std::list<Creature*> >  _creatures; // who's here?
};

#endif // H_SYMPHONY_OBJECT_FURNITURE
